<div class="content">
    <div class="header">
        <h1 class="page-title">管理员列表</h1>
    </div>

    <div class="well">
        <!-- search button -->
        <form action="" method="get" class="form-search">
            <div class="row-fluid" style="text-align: left;">
                <div class="pull-left span4 unstyled">
                    <p> 用户名：<input class="input-medium" name="" type="text"></p>
                </div>
            </div>
            <button type="submit" class="btn">查找</button>
            <a class="btn btn-primary" href="{:url('create')}">新增</a>
        </form>
    </div>
    <div class="well">
        <!-- table -->
        <table class="table table-bordered table-hover table-condensed">
            <thead>
                <tr>
                    <th>编号</th>
                    <th>用户名</th>
                    <th>昵称</th>
                    <th>邮箱</th>
                    <th>是否可用</th>
                    <th>上次登录时间</th>
                    <th>操作</th>
                </tr>
            </thead>
            <tbody>
                {foreach $list as $v}
                <tr class="success">
                    <td>{$v.id}</td>
                    <td>{$v.username}</td>
                    <td>{$v.nickname}</td>
                    <td>{$v.email}</td>
                    <td>{$v.status == 1 ? "可用" : "不可用"}</td>
                    <td>{$v.last_login_time}</td>
                    <td>
                        <a href="{:url('admin/manager/edit', ['id'=>$v.id])}"> 编辑 </a>
                        {if($v.role_id != 1)}
                        <a href="javascript:void(0);" onclick="if(confirm('确认删除？'))
                            location.href='{:url(\'admin/manager/delete\', [\'id\'=>$v.id])}'"> 删除
                            <!--此处最外层套了"" , 又套了一层'', 所以里面再有''就需要进行转义 -->
                        </a>
                        {/if}
                        {if($v.role_id) == 1} 管理员 {/if}
                        <a href="{:url('admin/manager/resetpw', ['id'=>$v.id])}"> 重置密码 </a>
                    </td>
                </tr>
                {/foreach}
            </tbody>
        </table>
        <!-- pagination -->
        <div class="pagination">
            <ul>
                <li><a href="#">Prev</a></li>
                <li><a href="#">1</a></li>
                <li><a href="#">2</a></li>
                <li><a href="#">3</a></li>
                <li><a href="#">4</a></li>
                <li><a href="#">Next</a></li>
            </ul>
        </div>
    </div>
    <!-- footer -->
    <footer>
        <hr>
        <p>? 2017 <a href="javascript:void(0);" target="_blank">ADMIN</a></p>
    </footer>
</div>